/**引入 publicPath 设置 */
import './micro'
import Vue from 'vue'
import App from './App.vue'
// import '@/utils/init.js';
import router from './router'
Vue.config.productionTip = false
// new Vue({
//  router,
//  render: function (h) { return h(App) }
// }).$mount('#app')
let app
/**
* 挂载函数
*/
function mount () {
	app = new Vue({
	el: '#app',
	router,
	render: function (h) { return h(App) }})
}/**
* 卸载函数
*/
function unmount () {
	app.$destroy()
	app.$el.innerHTML = ''
	app = null
}/**微前端环境下，注册mount和unmount方法 */
if (window.__MICRO_APP_ENVIRONMENT__) {
	window[`micro-app-${window.__MICRO_APP_NAME__}`] = { mount, unmount }
	//子应用获取基座下发的消息
	let datas = window.microApp.getData()
	console.log(datas,'111111')
	// 子应用监听到新的基座数据
	window.microApp.addDataListener((data)=>{
		console.log(data,'6666666666')
	})
	
}else {mount()}
	
